<%@ include file="database_ini.jsp"%>
<%@page contentType="text/html; charset=UTF-8"%>
  <%@page import="org.json.*"%>
  <%

	System.out.println("started:.....");
	String sql = "select * from a";
	
	pstmt = conn.prepareStatement(sql);
	//pstmt.setString(1 , listname);
	
	ResultSet rs = pstmt.executeQuery();
	JSONObject obj=new JSONObject();
	
	/****************
	JSONArray jsonChildarray = new JSONArray();
	
	while(rs.next()){
		
		String B = rs.getString("B");
		String C = rs.getString("C");
		JSONObject child = new JSONObject();
		child.put("B", B);
		child.put("C", C);
		System.out.println(B + C);
		jsonChildarray.put(child);
		
	}
	
	 
	 
    
    obj.put("jsonChildarray", jsonChildarray);
    /****************/
    
    /****************/
    System.out.println(request.getParameter("message"));
    
    //JSONObject messageobj = new JSONObject(request.getParameter("message"));
    //(JSONObject) JSONSerializer.toJSON((request.getParameter("message")));
    //String message = messageobj.getString("message");
    
    String message = request.getParameter("message");
    System.out.println(message);
    
    obj.put("message",message);
    
    
    /****************/
    response.sendRedirect("index.html");
    out.print(obj);
    System.out.println(obj);
    out.flush();
    
    conn.close();
    
    
  %>